package br.fbc.action;


import java.io.FileInputStream;
import java.io.InputStream;

import br.fbc.codigodebarras.GerarCodigoDeBarras;

import com.opensymphony.xwork2.ActionSupport;

public class DownloadAction extends ImageAction {
	
	private InputStream fileInputStream;
	private String userName= "qrforfun";
	private String qrfield;
	 
	
 
	public String execute() throws Exception {
		
		qrfield = getQrText(qrfield);
		
		fileInputStream = new FileInputStream(GerarCodigoDeBarras.getFileCodigoBarras(userName, qrfield));
	    return SUCCESS;
	}	

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public void setQrfield(String qrfield) {
		this.qrfield = qrfield;
	}
	public InputStream getFileInputStream() {
		return fileInputStream;
	}
}
